class TFNKLockOnFire extends TFProjectileFire;

/*var() float AimCone;
var() float MaxDist;

simulated function bool AllowFire()
{
    return true;
}

function DoFireEffect()
{
    local Pawn p;
    local Pawn bestP;
    local float bestWt;
    local vector toPawn;
    local vector eyeDir;
    local float cosdot;

    local float curwt;
    local float curdist;
    local float curdot;

    if ( (Instigator.Role < ROLE_Authority) || (Instigator.PlayerReplicationInfo == None) || (Instigator.PlayerReplicationInfo.Team == None) )
        return;

    bestP = None;
    cosdot = cos(AimCone*PI/180);
    eyeDir = Vector(Instigator.Controller.Rotation);
    bestWt = 0.0;

    foreach Instigator.VisibleActors(class'Pawn', p, MaxDist )
    {
        if ( (p == Instigator) || (p.PlayerReplicationInfo == None) || (P.PlayerReplicationInfo.Team != Instigator.PlayerReplicationInfo.Team) )
            continue;

        toPawn = p.Location - Instigator.Location;
        curdot = Normal(toPawn) dot eyeDir;
        curdist = VSize(toPawn);

        if( curdot < cosdot )
            continue;
        if( curdist > MaxDist )
            continue;

        curwt = 1.0 - (curDist / MaxDist);
        curwt *= curdot;
        if( curwt > bestWt )
        {
            bestWt = curwt;
            bestP = p;
        }
    }

    TFNKGun(Weapon).SetTarget(bestP);
}*/

function DoFireEffect()
{
    local Vector StartProj, StartTrace, X,Y,Z;
    local Rotator Aim;
    local Vector HitLocation, HitNormal;
    local Actor Other;
	local tfstation sgb;
//	local float Amount;

    Instigator.MakeNoise(1.0);
    Weapon.GetViewAxes(X,Y,Z);

    StartTrace = Instigator.Location + Instigator.EyePosition();
    StartProj = StartTrace + X*ProjSpawnOffset.X + Y*ProjSpawnOffset.Y + Z*ProjSpawnOffset.Z;

	Aim = AdjustAim(StartProj, AimError);

    Other = Trace(HitLocation, HitNormal, StartProj, StartTrace, true);
    if(Other!=None)
    {
        StartProj = HitLocation;
    }

    sgb=spawn(class'taskforces.tfstation'
        ,,,startproj,aim);
}

defaultproperties
{
     ProjSpawnOffset=(X=50.000000,Y=8.000000)
     bFireOnRelease=True
     FireRate=0.250000
     AmmoClass=Class'taskforces.TFNKAmmo'
}
